package two.chapter_2;

import org.junit.Test;
import two.chapter_1.c1_1.Printer;
import two.chapter_2.c2_1.*;
import two.chapter_2.c2_2.MergeBUSort;
import two.chapter_2.c2_2.MergeSort;
import two.chapter_2.c2_3.QuickSort;
import two.chapter_2.c2_4.HeapSort;
import two.chapter_2.c2_4.MyHeapSort;

public class SortTet {


    @Test
    public void testSelection(){
        Sortable<String> sort=new SelectionSort();
        String[] items={"a","f","s","d","b","c"};
        sort.sort(items);

        Printer.printArray(items);
    }
    @Test
    public void testInsertion(){
        Sortable<String> sort=new InsertionSort<>();
        String[] items={"a","f","s","d","b","c"};
        sort.sort(items);

        Printer.printArray(items);
    }

    @Test
    public void testShell(){
        Sortable<String> sort=new ShellSort<>();
        String[] items={"a","f","s","d","b","c"};
        sort.sort(items);

        Printer.printArray(items);
    }

    @Test
    public void testBubble(){
        Sortable<String> sort=new BubbleSort<>();
        String[] items={"a","f","s","d","b","c","a","f","s","d","b","c","a","f","s","d","b","c"};
        sort.sort(items);

        Printer.printArray(items);
    }
    @Test
    public void testMerge(){
        Sortable<String> sort=new MergeSort<>();
        String[] items={"a","f","s","d","b","c","a","f","s","d","b","c","a","f","s","d","b","c"};
        sort.sort(items);

        Printer.printArray(items);
    }
    @Test
    public void testMergeBU(){
        Sortable<String> sort=new MergeBUSort<>();
        String[] items={"a","f","s","d","b","c"};
        sort.sort(items);

        Printer.printArray(items);
    }

    @Test
    public void testQuick(){
        Sortable<String> sort=new QuickSort<>();
        String[] items={"d","b","f","s","a","e","c","i","h"};
        sort.sort(items);

        Printer.printArray(items);
    }

    @Test
    public void testHeap(){
        Sortable<String> sort=new MyHeapSort<>();
        String[] items={"d","b","f","s","a","e","c","i","h"};
        sort.sort(items);

        Printer.printArray(items);
    }
}
